DAC
 
 
 Bean DAC
 
D/A converter

Typical usage of the bean in user's code.

Typical Usage:

Assume the DAC bean that has name "DAC". A external device is connected to the DAOx output of this CPU. The DAC module allow to generate a sawtooth signal by SetChannel8 method of the bean.

  ...
  void main(void) {
    byte i = 0;                   /* counter variable */
    ...
    DAC1_Enable();                /* Enable DAC bean */
    for(;;) {
      if (i==255) {               /* Set new value of the counter */
        i=0;
      } else {
        i++;
      }
      DAC1_SetValue8(&i);         /* Set level of the output signal
                                     according to the value of i */
      ...
    }
  }

For more about typical usage of the bean code please refer to the page Bean Code Typical Usage.


Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.